package com.example.guiguihomemedical.mapper;

import com.example.guiguihomemedical.entity.Doctor;
import com.example.guiguihomemedical.entity.FamilyarChives;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FamilyarChivesMapper {
    @Select("select * from familyarchives where member_id=#{memberId}")
    FamilyarChives findByMemberId(String memberId);
    @Select("select * from familyarchives where household_id=#{householdId}")
    List<FamilyarChives> findByHouseholdId(String householdId);
    @Insert("INSERT INTO familyarchives (household_id, member_id, relationship) VALUES (#{householdId},#{memberId},#{relationship})")
    void insertFamilyarchives(String householdId,String memberId,String relationship);
    @Delete("DELETE FROM familyarchives WHERE household_id=#{householdId}")
    void deleteByHouseholdId(String householdId);

    @Delete("DELETE FROM familyarchives WHERE member_id=#{memberId}")
    void deleteByMemberId(String memberId);
    @Update("UPDATE familyarchives SET relationship = #{relationship} WHERE member_id = #{memberId}")
    void UpdateByMemberId(String memberId,String relationship);
}
